<!DOCTYPE html>
<html>
<head>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width,initial-scale=1,user-scalable=0">
    <%if(data.length!=0){%>
    <title><%=data[0].parent.name %></title>
    <%}%>
    <% include ../../common/public.ejs %>

    <link rel="stylesheet" href="//cdn.bootcss.com/weui/1.1.1/style/weui.min.css">
    <link rel="stylesheet" href="//cdn.bootcss.com/jquery-weui/1.0.1/css/jquery-weui.min.css">
    <link href="<%= global.config.path.publicPath %>/custom/css/articleTemplate.css" rel="stylesheet">
</head>
<body style="background-color: white">
<link rel="stylesheet" href="//cdn.bootcss.com/weui/1.1.1/style/weui.min.css">
<link rel="stylesheet" href="//cdn.bootcss.com/jquery-weui/1.0.1/css/jquery-weui.min.css">
<% let catalogs = data %>
<div class="weui-search-bar" id="searchBar">
    <form class="weui-search-bar__form" onsubmit="return submitForm()" >
        <div class="weui-search-bar__box">
            <i class="weui-icon-search"></i>
            <input type="search" class="weui-search-bar__input" id="searchInput" placeholder="搜索" required="">
            <a href="javascript:" class="weui-icon-clear" id="searchClear"></a>
        </div>
        <label class="weui-search-bar__label" id="searchText">
            <i class="weui-icon-search"></i>
            <span>搜索</span>
        </label>
    </form>
    <a href="javascript:" class="weui-search-bar__cancel-btn" id="searchCancel">取消</a>
</div>
<div class="sc-catalogContainer">
    <%if(catalogs.length!=0){%>
    <% for(let i = 0;i < catalogs.length;i++){ %>
    <a href="<%= global.config.path.contextPath %>/fengqi/article<%= catalogs[i].pageType %>?bookcase=<%= catalogs[i]._id %>">
        <div class="sc-catalogList">
            <div class="sc-circleList">
                <div class="weui-grid__icon ">
                    <%if(catalogs[i].icon){%>
                    <img src="<%= global.config.path.publicPath %>/uploadFiles<%= catalogs[i].icon.filePath %>" alt=""/>
                    <%}else{%>
                    <img src="<%= global.config.path.publicPath %>/custom/images/icon/WechatIMG51.png" alt=""/>
                    <%}%>
                </div>
            </div>
            <p class="text-center sc-weui-grid__label" style="font-size: 16px;color: #727563">
                <%= catalogs[i].name %>
            </p>
        </div>
    </a>
    <% } %>
    <%}else {%>
    <img src="<%=global.config.path.publicPath%>/custom/images/icon/nomore.png" alt="" class="noMore">
    <h2 class="text-center">暂无更多内容啦</h2>
    <%}%>
</div>
<script src="//cdn.bootcss.com/jquery/1.11.0/jquery.min.js"></script>
<script src="//cdn.bootcss.com/jquery-weui/1.0.1/js/jquery-weui.min.js"></script>
<script src="//cdn.bootcss.com/jquery-weui/1.0.1/js/swiper.min.js"></script>
<script src="<%= global.config.path.publicPath %>/custom/js/articleTemplate.js"></script>
<script>
    $('#searchInput').change(function () {
        let condition = $(this).val();
        location.href = '<%= global.config.path.contextPath %>/fengqi/article/searchAll?con=' + condition + '&bookcase=<%= id %>'
    });
    function submitForm() {
        return false
    }
</script>
</body>
</html>
